/*
 * MIT License
 *
 * Copyright (c) 2025 Mark·虎
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package com.hsxxherp.key.support.model.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 高级查询实体类
 *
 * @author Mark·虎
 * @version 1.0
 * @since 2025-2-23
 */
@Data
@Schema(name = "AdvancedQuery", description = "用于进行高级查询的实体类，包含根分组条件、分组字段、排序字段、排序方向和查询字段列表等信息")
public class AdvancedQuery {
    /**
     * 根分组条件
     */
    @Schema(name = "root_group", description = "根分组条件，用于定义查询的分组逻辑", example = "示例分组条件")
    private GroupCondition rootGroup;
    /**
     * 分组字段
     */
    @Schema(name = "group_by", description = "分组字段，用于对查询结果进行分组，例如按照某个数据库列名分组", example = "column_name")
    private String groupBy;
    /**
     * 排序字段
     */
    @Schema(name = "order_by", description = "排序字段，用于指定按照哪个字段对查询结果进行排序，例如某个数据库列名", example = "column_name")
    private String orderBy;
    /**
     * 排序方向，"asc"（升序）或 "desc"（降序）
     */
    @Schema(name = "order_direction", description = "排序方向，取值为 \"asc\"（升序）或 \"desc\"（降序），用于指定查询结果的排序顺序", example = "asc")
    private String orderDirection;
    /**
     * 查询字段列表
     */
    @Schema(name = "select_fields", description = "查询字段列表，用于指定要查询的数据库字段", example = "[\"field1\", \"field2\"]")
    private List<String> selectFields;
}